//类模板的实例化
#include <iostream>
using namespace std;

class Integer {
public:
	Integer(int i):m_i(i){}
private:
	int m_i;
};

template<typename T>
class CMath {
public:
	CMath(const T& t1, const T& t2) :m_t1(t1), m_t2(t2) {}
	T add() {
		return m_t1 + m_t2;
	}
	T add();
private:
	T m_t1;
	T m_t2;
};
/*
class CMath<int>{

public:
	CMath<int>(const int& t1,const int& t2):m_t1(t1),m_t2(t2){}

	int add(){
		return m_t1+ m_t2;
	}
private:
	int m_t1;
	int m_t2;
}*/
/*
class CMath<Integer>{
	public:
		CMath<Integer>(const Integer& t1,const Integer& t2):m_t1(t1),m_t2(t2){}
	private:
		Integer m_t1;
		Integer m_t2;
}
*/

/*
class CMath<int>{

public:
	CMath<Integer>(const int& t1,const int& t2):m_t1(t1),m_t2(t2){}

	Integer add(){
		return m_t1+ m_t2;
	}
private:
	int m_t1;
	int m_t2;
}*/
int main(void) {
	Integer ix = 100, iy = 200;
	CMath<Integer> m1(ix,iy);
	int nx = 10, ny = 20;
	CMath<int> m(nx,ny);
	m.add();
	return 0;
}